﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bankeren.Engine.Cards;
using Bankeren.Service;

namespace Bankeren.Engine
{
    public class Human : Player
    {
        #region Fields

        private IBankerenCallback callback;

        #endregion

        #region Ctor

        public Human(IBankerenCallback callback, Game game, PlayerInfo info, int seat) : base(game, info, seat)
        {
            this.callback = callback;
        }

        #endregion

        #region Methods

        #region Callback Methods

        public override void Welcome(int seat, Dictionary<int, PlayerInfo> players)
        {
            callback.Welcome(seat, players);
        }

        public override void PlayerJoined(int seat, PlayerInfo info)
        {
            callback.PlayerJoined(seat, info);
        }

        public override void PlayerInfoChanged(int seat, PlayerInfo info)
        {
            callback.PlayerInfoChanged(seat, info);
        }

        public override void PlayerLeft(int seat)
        {
            callback.PlayerLeft(seat);
        }

        public override void GameStarted()
        {
            callback.GameStarted();
        }

        public override void RoundStarted(int roundNumber, int numCards, int dealerSeat, Card trump)
        {
            callback.RoundStarted(roundNumber, numCards, dealerSeat, trump);
        }

        public override void Bids(Dictionary<int, int> bids)
        {
            callback.Bids(bids);
        }

        public override void TrickStarted(int trickNumber)
        {
            callback.TrickStarted(trickNumber);
        }

        public override void Turn(int seat, Suit followSuit)
        {
            callback.Turn(seat, followSuit);
        }

        public override void CardPlayed(int seat, Card card)
        {
            callback.CardPlayed(seat, card);
        }

        public override void TrickEnded(int winner)
        {
            callback.TrickEnded(winner);
        }

        public override void RoundEnded(Dictionary<int, int> points)
        {
            callback.RoundEnded(points);
        }

        public override void GameEnded(int winner)
        {
            callback.GameEnded(winner);
        }

        public override void Chat(int seat, string message)
        {
            callback.Chat(seat, message);
        }

        public override void ServerStopped(string message)
        {
            callback.ServerStopped(message);
        }

        public override void DealCards(List<Card> cards)
        {
            base.DealCards(cards);
            callback.DealCards(cards);
        }

        #endregion

        #endregion
    }
}
